/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.guobo.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.guobo.entity.ExhHall;
import com.thinkgem.jeesite.modules.guobo.entity.Location;
import com.thinkgem.jeesite.modules.guobo.dao.LocationDao;

/**
 * 位置Service
 * @author wudavid
 * @version 2017-03-09
 */
@Service
@Transactional(readOnly = true)
public class LocationService extends CrudService<LocationDao, Location> {

	public Location get(String id) {
		return super.get(id);
	}
	
	public List<Location> findList(Location location) {
		return super.findList(location);
	}
	
	public Page<Location> findPage(Page<Location> page, Location location) {
		return super.findPage(page, location);
	}
	
	@Transactional(readOnly = false)
	public void save(Location location) {
		super.save(location);
	}
	
	@Transactional(readOnly = false)
	public void delete(Location location) {
		super.delete(location);
	}
	
	/**
	 * 根据展馆id查询位置信息
	 * @param exhHallId 展馆id
	 * @return
	 */
	public List<Location> findListByExhHallId(String exhHallId){
		Location location = new Location();
		ExhHall exhHall = new ExhHall();
		exhHall.setId(exhHallId);
		location.setExhHall(exhHall);
		return dao.findListByExhHallId(location);
	}
}